package com.example.guiguihomemedical.service.impl;

import com.example.guiguihomemedical.entity.Servicepack;
import com.example.guiguihomemedical.mapper.ServicepackMapper;
import com.example.guiguihomemedical.service.ServicepackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ServicepackServiceImpl implements ServicepackService {
    @Autowired
    private ServicepackMapper servicepackMapper;

    @Override
    public void delete(Integer id) {
        servicepackMapper.delete(id);
    }

    @Override
    public void add(Servicepack servicepack) {
        servicepackMapper.insert(servicepack);
    }

    @Override
    public Servicepack getById(Integer id) {
        return servicepackMapper.getById(id);
    }

    @Override
    public void update(Servicepack servicepack) {
        servicepackMapper.updateById(servicepack);
    }

    @Override
    public List<Servicepack> getByName(String name) {
        return servicepackMapper.getByName(name);
    }

    @Override
    public List<Servicepack> getAll() {
        return servicepackMapper.getAll();
    }

    @Override
    public List<Servicepack> getByType(String type) {
        return servicepackMapper.getByType(type);
    }
}
